<!DOCTYPE html>
<html lang="en">
<link>

    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>Order_OrderItem_Detail管理</title>
    <meta name="description" content="Order_OrderItem_Detail管理">
    <meta name="keywords" content="Order_OrderItem_Detail管理">
    <meta content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no" name="viewport">

    <!-- 引入样式/组件 -->
    <link rel="icon" href="../img/favicon.ico">
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <link rel="stylesheet" href="../plugins/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="../css/style.css">
    <link rel="stylesheet" href="../css/elementui.css"/>
    <script src="../js/vue.js"></script>
    <script src="../js/elementui.js"></script>
    <script src="../js/axios.js"></script>
    <script src="../js/util.js"></script>

<body class="hold-transition">

<div id="app">

    <div class="content-header">
        <h1>Order_OrderItem_Detail管理<small>Order_OrderItem_Detail管理</small></h1>
        <el-breadcrumb separator-class="el-icon-arrow-right" class="breadcrumb">
            <el-breadcrumb-item :to="{ path: '/' }">首页</el-breadcrumb-item>
            <el-breadcrumb-item>Order_OrderItem_Detail管理</el-breadcrumb-item>
            <el-breadcrumb-item>Order_OrderItem_Detail管理</el-breadcrumb-item>
        </el-breadcrumb>
    </div>

    <div class="app-container">
        <div class="box">

            <el-button type="primary" onclick="location.href='order_orderItem_list.html'">返回订单列表</el-button>
            
            <!-- order是订单组合表里面Order表的变量 -->
            <p>用户名: {{orderDetail.order.username}}</p>
            <p>收货人：{{orderDetail.order.receiverContact}}</p>
            <!-- orderItem是订单组合表里面OrderItem表的变量 -->
            <el-table :data="orderDetail.orderItem"
                      style="width:100%">
                <el-table-column
                                        prop="id"
                                        label="ID"
                                        width="180">
                </el-table-column>
                <el-table-column
                                        prop="name"
                                        label="商品名称"
                                        width="180">
                </el-table-column>
                <el-table-column
                                        prop="price"
                                        label="单价"
                                        width="180">
                </el-table-column>
            </el-table>

        </div>
    </div>
</div>

<script>

    var id = getQueryString("oid");

    new Vue({
        el: "#app",
        data:{
            orderDetail:{}
        },
        created(){
            this.findPage();
        },
        methods:{
            findPage(){
                axios.get(`/order/findById.do?id=`+id).then(
                    res => {
                        this.orderDetail = res.data;
                    }
                )
            }
        }
    })
</script>

</body>
</html>